<template>
    <div>
        {{formateNikeName}}

        <div>
            电话号码： {{$store.state.moduleA.tel}} - {{moduleA.tel}}
        </div>
        <button @click="changeTel({tel: 911, name:'李四'})">点击修改电话号码</button>
    </div>
</template>

<script>
import { mapGetters, mapState, mapMutations } from 'vuex'
export default {
    name: '',
    computed: {
        ...mapGetters(['formateNikeName']),
        ...mapState(['moduleA'])
    },
    created() {
        // console.log(this.$store);
    },
    methods:{
        ...mapMutations(['changeTel'])
    },
 }
</script>

<style scoped>
div {
    text-align: center;
}
</style>